import { requset, requset2 } from "./request"
// 查看轮播图列表

export const getBanners= (): axiosTypes<addmsType[]> =>{
    return requset("/app/gettmsbanners","POST")
}

// 查看面试列表
export const getmsLIst = (obj?:any): listTpes =>{
    return requset("/app/gethomelist","POST",{...obj})
}

// 查看详情列表数据
export const getmsbyid = (_id:string): axiosTypes<addmsType> =>{
    return requset("/app/getmsbyid","POST",{_id})
}
 


// 发送验证码
export const  sentYzm = (phone: string): YzmTypes =>{
    return requset2('/captcha/sent',"GET",{phone})
}

// 验证验证码
export const YZYzm = (phone: string, captcha: string): YzmTypes =>{
    return requset2("/captcha/verify", "GET",{phone,captcha})
}

// 获取token
export const getToken = (phone:string): tokenType =>{
    return requset('/app/gettoken',"POST",{
        phone
    })
}

//查看是否已经点赞
export const userLikes = (phone:string,mid?:string): axiosTypes<getUserTypes[]> =>{
    return requset('/app/getmslikes',"POST",{phone,mid})
}

// 添加到已经点赞
export const clickLikes = (phone:string,mid:string,msobj:addmsType) : axiosTypes<getUserTypes[]> =>{
    return requset("/app/addlikeone","POST",{phone,mid,msobj})
}

// 改变点赞数据
export const changeLikes = (_id:string,likes?:number): axiosTypes<changeLikeType> =>{
    return requset('/app/changemsinfo',"POST",{_id,likes})
}

// 取消点赞的数据
export const deleteLikes = (mid:string,phone:string): axiosTypes<deleteTpes> =>{
    return requset("/app/dellikeone","POST",{mid,phone})
}

// 查看是否已经收藏
export const userCol = (phone:string,mid?:string): axiosTypes<getUserTypes[]> =>{
    return requset("/app/getcollectlist","POST",{mid,phone})
}

// 添加收藏
export const addCol = (phone:string,mid:string,msobj:addmsType): axiosTypes<getUserTypes[]> =>{
    return requset("/app/addcollectone","POST",{phone,mid,msobj})
}

// 改变收藏数据
export const changeCol = (_id:string,collects:number): axiosTypes<changeLikeType> =>{
    return requset('/app/changemsinfo',"POST",{_id,collects})
}
// 删除收藏
export const delCol = (mid:string,phone:string): axiosTypes<deleteTpes> =>{
    return requset('/app/delcollectone',"POST",{mid,phone})
}

// 添加到已经评论中
export const addPings = (rate:number,comment:string,msobj:addmsType,time:Date,mid:string): axiosTypes<pingsType[]> =>{
    return requset("/app/addpingsone","POST",{mid,rate,comment,time,msobj})
}

// 获取评论列表
export const  getPings = (mid:string): axiosTypes<pingsType[]> =>{
    return requset("/app/getpinglist","POST",{mid})
}
// 获取评论列表
export const getPing = (phone:string): axiosTypes<pingsType[]> =>{
    return requset("/app/getpinglist","POST",{phone})
}
// 改变评论数据
export const changePings = (_id:string,pings?:number): axiosTypes<changeLikeType> =>{
    return requset('/app/changemsinfo',"POST",{_id,pings})
}

//查看我的面试
export const getMs = (phone:string): axiosTypes<addmsType[]> =>{
    return requset("/app/getmyinterviews","POST",{phone})
}

//添加面试
export const addMainShi = (params:MsdataTypes): axiosTypes<addmsType> =>{
    return requset('/app/addmainshi',"POST",params)
}

